Generating Bracelets in Constant Amortized Time
نویسنده
چکیده
A bracelet is the lexicographically smallest element in an equivalence class of strings under string rotation and reversal. We present a fast, simple, recursive algorithm for generating (i.e., listing) k-ary bracelets. Using simple bounding techniques, we prove that the algorithm is optimal in the sense that the running time is proportional to the number of bracelets produced. This is an improvement by a factor of n (where n is the length of the bracelets being generated) over the fastest, previously known algorithm to generate bracelets.
منابع مشابه
Generating bracelets with fixed content
We present an algorithm to generate bracelets with fixed content. An analysis shows that the algorithm runs in constant amortized time. The algorithm can be applied to efficiently list all non-isomorphic unicyclic graphs with n vertices.
متن کاملCharm bracelets and their application to the construction of periodic Golay pairs
A k-ary charm bracelet is an equivalence class of length n strings with the action on the indices by the additive group of the ring of integers modulo n extended by the group of units. By applying an O(n3) amortized time algorithm to generate charm bracelet representatives with a specified content, we construct 29 new periodic Golay pairs of length 68.
متن کاملOn the generation of convex polyominoes
We present a simple but efficient method for generating the set LPol(n) of L-convex polyominoes of size n. We show a bijection between LPol(n) and a suitable set of pairs of integer sequences. This lets us design a CAT (Constant Amortized Time) algorithm for generating LPol(n) using O( √ n) space.
متن کاملA CAT algorithm for generating permutations with a fixed number of inversions
We develop a constant amortized time (CAT) algorithm for generating permutations with a given number of inversions. We also develop an algorithm for the generation of permutations with given index.
متن کاملEfficient generating algorithm for permutations with a fixed number of excedances
In this paper, we develop a constant amortized time (CAT) algorithm for generating permutations with a fixed number of excedances. We obtain a Gray code for permutations having one excedance. We also give a bijection between the set of n-length permutations with exactly one excedance and the set Sn(321, 2413, 3412, 21534)\{123 . . . (n− 1)n}. This induces a Gray code for the set Sn(321, 2413, 3...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- SIAM J. Comput.
دوره 31 شماره
صفحات -
تاریخ انتشار 2001